package com.niiwoo.civet.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 注册渠道
 */
@Getter
@AllArgsConstructor
public enum DrainageChannelsEnum {

    CHANNEL_ACTIVITY((byte) 0, "活动渠道"),
    ADVERTISING_CHANNELS((byte) 1, "广告投放渠道"),
    OFFICIAL_CHANNEL((byte) 2, "官方渠道"),
    SPEED_CHANNEL((byte) 3, "极速借API渠道"),
    THIRD_PARTY_CHANNELS((byte) 4, "第三方渠道"),
    OFFLINE_ACTIVITY((byte) 5, "线下活动");

    private Byte type;
    private String desc;

    public static DrainageChannelsEnum of(byte value) {
        for (DrainageChannelsEnum t : values()) {
            if (t.type == value) {
                return t;
            }
        }
        return null;
    }

    @Getter
    @AllArgsConstructor
    public enum IsShowWindow {

        CLOSE_WINDOW((byte) 0, "关闭窗口"),
        OPEN_WINDOW((byte) 1, "打开窗口");

        private Byte value;
        private String desc;

        public static IsShowWindow enumOf(byte value) {
            for (IsShowWindow channel : values()) {
                if (channel.value == value) {
                    return channel;
                }
            }
            return null;
        }
    }

}
